package com.carl.zeus.server.system;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.carl.zeus.dao.system.SysLogMapper;
import com.carl.zeus.model.system.SysLog;
import com.carl.zeus.model.system.SysRole;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 系统日志 服务类
 * </p>
 *
 * @author zcm
 * @since 2017-10-28
 */

@Service
public class SysLogService extends ServiceImpl<SysLogMapper, SysLog> {

	@Autowired
	private SysLogMapper sysLogMapper;

	public List<SysLog> listAjax(int page, int limit, String key, String value) {
		List<SysLog> logList = sysLogMapper.selectPage(
				new Page<SysLog>(page, limit),
				new EntityWrapper<SysLog>().like(key, value));
		return logList;
	}

	public Integer countRoleList() {
		return sysLogMapper.selectCount(new EntityWrapper<>());
	}
}
